home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / state.h < prev    next >
C/C++ Source or Header  |  1999-03-18  |  2KB  |  50 lines

  1. #ifndef _STATE_H
  2. #define _STATE_H
  3.  
  4. #include "osd_cpu.h"
  5.  
  6. /* Amount of memory to allocate while reading variable size arrays */
  7. /* Tradeoff between calling realloc all the time and wasting memory */
  8. #define CHUNK_SIZE  64
  9.  
  10. /* Interface to state save/load functions */
  11.  
  12. /* Close a state file; free temporary memory at the same time */
  13. void state_close(void *state);
  14.  
  15. /* Create a new state file; name should normally be the games name */
  16. void *state_create(const char *name);
  17.  
  18. /* Open an existing state file */
  19. void *state_open(const char *name);
  20.  
  21. /* Save data of various element size and signedness */
  22. void state_save_UINT8(void *state, const char *module,int instance,
  23.     const char *name, const UINT8 *val, unsigned size);
  24. void state_save_INT8(void *state, const char *module,int instance,
  25.     const char *name, const INT8 *val, unsigned size);
  26. void state_save_UINT16(void *state, const char *module,int instance,
  27.     const char *name, const UINT16 *val, unsigned size);
  28. void state_save_INT16(void *state, const char *module,int instance,
  29.     const char *name, const INT16 *val, unsigned size);
  30. void state_save_UINT32(void *state, const char *module,int instance,
  31.     const char *name, const UINT32 *val, unsigned size);
  32. void state_save_INT32(void *state, const char *module,int instance,
  33.     const char *name, const INT32 *val, unsigned size);
  34.  
  35. /* Load data of various element size and signedness */
  36. void state_load_UINT8(void *state, const char *module,int instance,
  37.     const char *name, UINT8 *val, unsigned size);
  38. void state_load_INT8(void *state, const char *module,int instance,
  39.     const char *name, INT8 *val, unsigned size);
  40. void state_load_UINT16(void *state, const char *module,int instance,
  41.     const char *name, UINT16 *val, unsigned size);
  42. void state_load_INT16(void *state, const char *module,int instance,
  43.     const char *name, INT16 *val, unsigned size);
  44. void state_load_UINT32(void *state, const char *module,int instance,
  45.     const char *name, UINT32 *val, unsigned size);
  46. void state_load_INT32(void *state, const char *module,int instance,
  47.     const char *name, INT32 *val, unsigned size);
  48.  
  49. #endif
  50.